home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cdtray1a / class1.cls < prev    next >
Text File  |  1999-09-29  |  1KB  |  49 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsCDTray"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Private Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
  15. Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
  16.  
  17. Public CdTrayOpen As Boolean
  18.  
  19.  
  20. Function OpenCDTray()
  21.    mciSendString "set cd door open", 0, 0, 0
  22. End Function
  23.  
  24.  
  25.  
  26. Function CloseCDTray()
  27.     mciSendString "set cd door closed", 0, 0, 0
  28. End Function
  29.  
  30.  
  31.  
  32. Function UnloadAll()
  33.     mciSendString "close all", 0, 0, 0
  34. End Function
  35.  
  36. Function SetCDReady()
  37.     mciSendString "open cdaudio alias cd wait shareable", 0, 0, 0
  38. End Function
  39. Function SetFormat()
  40.     mciSendString "set cd time format tmsf wait", 0, 0, 0
  41. End Function
  42.  
  43. Function InitCD()
  44.     CloseCDTray
  45.     SetCDReady
  46.     SetFormat
  47. End Function
  48.  
  49.